package day8;

/**
 * @author oldliu
 * @since 1.0
 */
public class Thread1 extends Thread {
    public Thread1(String n){
        super(n);
    }
    //线程要执行的任务·
    @Override
    public void run() {
        for (int i = 1; i <=20 ; i++) {
            System.out.println(getName()+" print :"+i);
        }
    }

    public static void main(String[] args) {
        //至少5个线程（1主+4个子线程）
        for(int i=1;i<=4;i++){
            //new Thread1("线程"+i).run();
            new Thread1("线程"+i).start();
        }
    }
}
